import * as CryptoJS from 'crypto-js';

/**
 *
 * @param {'解密值'} word
 * @returns
 */
function newDecrypt(word: string, newDefaultKey: string): string {
  var key = CryptoJS.enc.Utf8.parse(newDefaultKey);
  var decrypt = CryptoJS.AES.decrypt(word, key, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Pkcs7,
  });
  return CryptoJS.enc.Utf8.stringify(decrypt).toString();
}

export { newDecrypt };
